
#pragma once

#include "TypedList.h"

template <class T>
class TypedStack : public TypedList<T>
{
	public:

		TypedStack() : TypedList<T>( false )
		{}

		void Push( T* pxItem )
		{
			this->Add( pxItem );
		}

		T* Pop()
		{
			if( this->Count() == 0 )
			{
				return 0;
			}
			
			T* pxItem = Get( this->Count() - 1 );
			Delete( this->Count() - 1 );
			return pxItem;
		}

		T* GetTop()
		{
			if( this->Count() == 0 )
			{
				return 0;
			}
			
			return this->Get( this->Count() - 1 );
		}
};

// eof
